﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Web;
using RIMS.Lib.Manager;
using RIMS.Lib.Models;

namespace RIMS.Web.Utility.CacheUtility
{
    internal class RoleCacheUtility : CacheUtility<Role>
    {
        public void Init()
        {
            IList<Role> roleList = new RoleManager().GetAll();
            AddToList = roleList;
        }

        internal override Role Read(Guid guid)
        {
            return All.FirstOrDefault(I => I.OID.Equals(guid));
        }

//        protected override Expression<Func<Role, bool>> GetOIDSelector(Guid guid)
//        {
//            return (item) => item.OID == guid;
//        }
    }
}